//Nazov casopisu, cislo, nazovstvo, cena
#include <iostream>
#include <fstream>
#include <string>

using namespace std;
//------------------------------------------------------------------------
int napln(){

	int cislo=1;
	string nazov;
	float cena;
	char c = 'a';
	
  ofstream subor("zoznam.cdb",ios::trunc);

	
	while (c == 'a') {
		cout << "Cislo: ";
		cin >> cislo;


		cout << "nazov: ";
		cin.ignore();
		getline(cin, nazov);

		cout << "Cena: ";
		cin >> cena;


		cout << endl << "Vstup: " << "\t" << cislo << "\t" << nazov << "\t" << cena << endl;
		subor << "\t" << cislo << "\t" << nazov << "\t" << cena << endl;

		cout << "Pokracovat? [a/n] ";
		cin >> &c;
		
	}
	

	

	subor.close();

  return 0;
}
//------------------------------------------------------------------------
int citaj(int cis_r) {
	string riadok;
	int i=0;
	bool getout=false;
	ifstream subor("zoznam.cdb");


	while(getline(subor, riadok) && !getout) {
		if (++i == cis_r) {
			cout << riadok << endl;
			getout = true;
		}

	}
	subor.close();
return 0;
}
//------------------------------------------------------------------------

//------------------------------------------------------------------------
int main(){
  cout << "Hovno!\n";
//  napln();
	citaj(2);
	

return 0;
}
